#!/bin/bash

# 配置 ip 地址
# master节点执行



sudo kubeadm init \
    --pod-network-cidr=10.244.0.0/16 \
    --service-cidr=10.96.0.0/12 \
    --apiserver-advertise-address=192.168.20.233 \
    --control-plane-endpoint=192.168.20.233 \
    --image-repository=registry.aliyuncs.com/google_containers \
    --cri-socket=unix:///var/run/containerd/containerd.sock \
    --upload-certs


[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
  [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
    endpoint = [
      "https://hub-mirror.c.163.com",
      "https://mirror.baidubce.com",
      "https://docker.mirrors.sjtug.sjtu.edu.cn"
    ]
  [plugins."io.containerd.grpc.v1.cri".registry.mirrors."k8s.gcr.io"]
    endpoint = ["registry.aliyuncs.com/google_containers"]
  [plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry.k8s.io"]
    endpoint = ["registry.aliyuncs.com/google_containers"]


    sudo docker run -d \
    --restart=unless-stopped \
    --name=kuboard \
    -p 80:80/tcp \
    -p 10081:10081/tcp \
    -e KUBOARD_ENDPOINT="http://192.168.20.233:80" \
    -e KUBOARD_AGENT_SERVER_TCP_PORT="10081" \
    -v /root/kuboard-data:/data \
    swr.cn-east-2.myhuaweicloud.com/kuboard/kuboard:v3